<template>
  <div class="warpper">
    <swiper :options="swiperOption" ref="mySwiper">
      <!-- slides -->
      <swiper-slide v-for="item of swiperList" :key="item.id">
        <img class="swiper-img" :src="item.imgUrl">
			</swiper-slide>
        <!-- 设置成循环的模式 -->
        <!-- <swiper-slide><img class="swiper-img" src="//img1.qunarzz.com/vc/a5/e0/64/c6bd8680fb67247db15df6057b.jpg"></swiper-slide> -->
        <!-- Optional controls -->
        <div class="swiper-pagination" slot="pagination"></div>
        <!-- 轮播图图标放置处 -->
        <!--    <div class="swiper-button-prev" slot="button-prev"></div>
			<div class="swiper-button-next" slot="button-next"></div>
			左右箭头
			-->
        <!--  <div class="swiper-scrollbar"   slot="scrollbar"></div> 下面滚动条 -->
    </swiper>
  </div>
</template>
<script>
export default {
  name: 'HomeSwiper',
  data () {
    return {
      // 引入轮播图下面的图标
      swiperOption: {
        pagination: '.swiper-pagination'
      }
    }
  },
  props: {
    swiperList: Array
  }
}

</script>
<style lang="stylus" scoped>
.warpper >>> .swiper-pagination-bullet-active
	background: #fff
	/*由于swiper-pagination-bullet-active是外部的组件所以需要使用>>>来穿透*/
.warpper
/*这样设置可以使得下面的组件不会有移位*/
	overflow: hidden
	width: 100%
	height: 0
	padding-bottom: 30.47%
	background-color: #eee
	.swiper-img
		width: 100%
</style>
